﻿using NUnit.Framework;

namespace CsvImporter.Test
{
  [TestFixture]
  internal class TestTableGenerator
  {
    [Test]
    public void TestOneRowOneCol()
    {
      var input = new[] { "kjhkjhef9837986;5789" };
      var result = TableGenerator.GenerateTable(input);

      var expected = new[]
                       {
                         new[]
                           {
                             input[0],
                           }
                       };

      Assert.That(result, Is.EqualTo(expected));
    }
    [Test]
    public void TestTwoRowsFiveCols()
    {
      var input = new[]
                    {
                      "a1,a2,a3,a4,a5",
                      "b1,b2,b3,b4,b5",
                      "c1,c2,c3,c4,c5",
                      "d1,d2,d3,d4,d5",
                      "e1,e2,e3,e4,e5",
                    };
      var result = TableGenerator.GenerateTable(input);

      var expected = new[]
                       {
                         new[]{"a1", "a2", "a3", "a4", "a5"},
                         new[]{"b1", "b2", "b3", "b4", "b5"},
                         new[]{"c1", "c2", "c3", "c4", "c5"},
                         new[]{"d1", "d2", "d3", "d4", "d5"},
                         new[]{"e1", "e2", "e3", "e4", "e5"},
                       };

      Assert.That(result, Is.EqualTo(expected));
    }
  }
}
